/*!
 * \file frdbg_rename_filename.c
 *
 * All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.\n
 *
 * \version 3.0
 * \author geyh
 * \date 2016/03/31
 *
 */
#include <CUnit/Basic.h>
#include <stdlib.h>
#include "frcomm.h"
#include "frmem.h"

#include "conntrack.h"
#include "frreport_comm.h"
#include "frreport_dbg.h"

#include "apmtest_comm.h"

static int __suite_init(void)
{

    return 0;
}

static int __suite_cleanup(void)
{

    return 0;
}


int frdbg_rename_filename(const char *p_oldname, char **p_newname);

static void __case1(void)
{
    int i_ret = 0;
    char *p_oldname = (char *)frstrdup((char *)"/filename.txt");
    char *p_newname = NULL;

    i_ret = frdbg_rename_filename(p_oldname, &p_newname);

    CU_ASSERT_EQUAL(i_ret, FR_SUCC);
    CU_ASSERT_STRING_EQUAL(p_newname,"/filename_1.txt");

    frfree(p_oldname);
    frfree(p_newname);

    return;

}

int add_suite_frdbg_rename_filename(void)
{
    CU_pSuite pSuite = NULL;

    if ((pSuite = CU_add_suite("frtds_convert frdbg_rename_filename()", __suite_init, __suite_cleanup)) == NULL)
        return FR_FAIL;

    CU_add_test(pSuite, "case1", __case1);
//    CU_add_test(pSuite, "case2", __case2);
//    CU_add_test(pSuite, "case3", __case3);
//    CU_add_test(pSuite, "case4", __case4);


    return FR_SUCC;
}
